<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      div{
        height: 20px;
      }
    </style>
    <title></title>
  </head>
  <body>
    <div id="app">
      <btn-a :css="color1" ></btn-a>
      <btn-a :css="color2"></btn-a>
    </div>
    <script src="./vue.js"></script>
    <script>
       Vue.component("btn-a",{
        template:`<div :style="css"></div>`,
        props:["css"],
        
      })
      const vm=new Vue({
        el:'#app',
        data:{
          color1:{background:"red"},
          color2:{background:"blue"},
        },
        methods:{},
       })
    </script>
  </body>
</html>